package com.ruoyi.mall.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.mall.entity.MallPackageRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mall.mapper.MallPackageRecordMapper;
import com.ruoyi.mall.service.IMallPackageRecordService;
import com.ruoyi.common.core.text.Convert;

/**
 * 购买优惠包记录表Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-05-28
 */
@Service
public class MallPackageRecordServiceImpl implements IMallPackageRecordService 
{
    @Autowired
    private MallPackageRecordMapper mallPackageRecordMapper;

    /**
     * 查询购买优惠包记录表
     * 
     * @param packageRecordId 购买优惠包记录表ID
     * @return 购买优惠包记录表
     */
    @Override
    public MallPackageRecord selectMallPackageRecordById(Long packageRecordId)
    {
        return mallPackageRecordMapper.selectMallPackageRecordById(packageRecordId);
    }

    /**
     * 查询购买优惠包记录表列表
     * 
     * @param mallPackageRecord 购买优惠包记录表
     * @return 购买优惠包记录表
     */
    @Override
    public List<MallPackageRecord> selectMallPackageRecordList(MallPackageRecord mallPackageRecord)
    {
        return mallPackageRecordMapper.selectMallPackageRecordList(mallPackageRecord);
    }

    /**
     * 新增购买优惠包记录表
     * 
     * @param mallPackageRecord 购买优惠包记录表
     * @return 结果
     */
    @Override
    public int insertMallPackageRecord(MallPackageRecord mallPackageRecord)
    {
        mallPackageRecord.setCreateTime(DateUtils.getNowDate());
        return mallPackageRecordMapper.insertMallPackageRecord(mallPackageRecord);
    }

    /**
     * 修改购买优惠包记录表
     * 
     * @param mallPackageRecord 购买优惠包记录表
     * @return 结果
     */
    @Override
    public int updateMallPackageRecord(MallPackageRecord mallPackageRecord)
    {
        return mallPackageRecordMapper.updateMallPackageRecord(mallPackageRecord);
    }

    /**
     * 删除购买优惠包记录表对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteMallPackageRecordByIds(String ids)
    {
        return mallPackageRecordMapper.deleteMallPackageRecordByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除购买优惠包记录表信息
     * 
     * @param packageRecordId 购买优惠包记录表ID
     * @return 结果
     */
    @Override
    public int deleteMallPackageRecordById(Long packageRecordId)
    {
        return mallPackageRecordMapper.deleteMallPackageRecordById(packageRecordId);
    }
}
